package com.zhoushihao.class0808;

import java.util.Scanner;

public class NextDay {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int D = sc.nextInt();
        int next = (D+2)%7;
        if(next == 0) next = 7;
        System.out.println(next);
    }
}
